import request from '@/utils/request'
import { encryptes } from '@/utils/jsencrypt'
// 登录方法
export function login(data) {
    let postdata = JSON.parse(JSON.stringify(data))
    postdata.password = encryptes(postdata.password)
    return request({
        url: '/login',
        method: 'post',
        data: postdata
    })
}
// 登录方法
export function login2(data) {
    let postdata = JSON.parse(JSON.stringify(data))
    return request({
        url: '/loginNotCode',
        method: 'post',
        data: postdata
    })
}
// 获取用户详细信息
export function getUserInfo() {
    return request({
        url: '/getInfo',
        method: 'get'
    })
}

// 退出登陆
export function logout() {
    return request({
        url: '/logout',
        method: 'post'
    })
}

// 获取验证码
export function getCodeImg() {
    return request({
      url: '/captchaImage',
      method: 'get'
    })
  }